package com.bjsxt.shop.common.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateFormatUtil
{
	public static String strDatePattern = ConstantFinalUtil.BUNDLE.getString("date.format");
	public static String strDateTimePattern = ConstantFinalUtil.BUNDLE.getString("date.time.format");
	/**
	 * 字符串转换成日期格式
	 * @param strDate
	 * @return
	 * @throws ParseException
	 */
	public Date toDate(String strDate) throws ParseException
	{
		Date date = new SimpleDateFormat(strDatePattern).parse(strDate);
		return date;
	}
	
	public Date toTimeDate(String strDate) throws ParseException
	{
		Date date = new SimpleDateFormat(strDateTimePattern).parse(strDate);
		return date;
	}
}
